/*=============================================================================

  Library: CFS

  Copyright (c) German Cancer Research Center,
    Division of Medical and Biological Informatics

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

=============================================================================*/

#ifndef CFSPLUGINFRAMEWORKFACTORY_H
#define CFSPLUGINFRAMEWORKFACTORY_H

#include <QHash>
#include <QString>
#include <QVariant>
#include <QSharedPointer>

#include "CFSPluginFrameworkExport.h"

#include "CFSPluginFramework_global.h"

class CFSPluginFramework;
class CFSPluginFrameworkContext;

/**
 * \ingroup PluginFramework
 * A factory for creating CFSPluginFramework instances.
 */
class CFS_PLUGINFW_EXPORT CFSPluginFrameworkFactory
{

public:

  /**
   * Create a new <code>%CFSPluginFrameworkFactory</code> instance.
   *
   * <p>
   * The CFSProperties map is used to configure the CFSPluginFramework. The
   * plugin framework instance created with #getFramework() must interpret
   * the following properties:
   *
   * <p>
   * <ul><li>CFSPluginConstants::FRAMEWORK_STORAGE</li>
   * </ul>
   *
   * @param initProps The plugin framework configuration properties.
   *        The CFSPluginFramework instance created with #getFramework()
   *        must use some reasonable default configuration if certain
   *        properties are not provided.
   */
  CFSPluginFrameworkFactory(const CFSProperties& initProps = CFSProperties());

  ~CFSPluginFrameworkFactory();

  /**
   * Create a new CFSPluginFramework instance.
   *
   * @return A new, configured CFSPluginFramework instance. The plugin
   *         framework instance must be in the CFSPlugin::INSTALLED state.
   */
  QSharedPointer<CFSPluginFramework> getFramework();

private:

  CFSPluginFrameworkContext* fwCtx;

};


#endif // CFSPLUGINFRAMEWORKFACTORY_H
